package com.pet.controller;

import com.pet.pojo.Item;
import com.pet.service.ItemDescService;
import com.pet.service.ItemService;
import com.pet.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/*  万钱  */
@RestController
@CrossOrigin
@RequestMapping("itemDesc")
public class ItemDescController {
    @Autowired
    private ItemDescService itemDescService;
    private Integer id;

    @GetMapping("/getId/{id}")
    public void getId(@PathVariable Integer id){
        this.id = id;
        System.out.println(id);
    }

    @GetMapping("/getById")
    public SysResult getItemDescById(){
        Item item = itemDescService.getItemDescById(id);
        return SysResult.success(item);
    }

}
